package com.lesso.yjy.sunflower.app.service.impl;

import com.baomidou.mybatisplus.plugins.Page;
import com.lesso.yjy.sunflower.domain.service.EmployeeDomainService;
import com.lesso.yjy.sunflower.pojo.dto.EmployeeDTO;
import com.lesso.yjy.sunflower.pojo.dto.EmployeeQueryDTO;
import com.lesso.yjy.sunflower.pojo.vo.EmployeeVO;
import com.lesso.yjy.sunflower.service.IEmployeeService;
import org.apache.dubbo.config.annotation.DubboService;
import org.springframework.stereotype.Service;

@Service
@DubboService
public class EmployeeServiceImpl implements IEmployeeService {
    private final EmployeeDomainService employeeDomainService;

    public EmployeeServiceImpl(EmployeeDomainService employeeDomainService) {
        this.employeeDomainService = employeeDomainService;
    }

    @Override
    public Long save(EmployeeDTO dto) {
        return employeeDomainService.save(dto);
    }

    @Override
    public Page<EmployeeVO> page(EmployeeQueryDTO dto) {
        return employeeDomainService.page(dto);
    }

    @Override
    public Page<EmployeeVO> customPage(EmployeeQueryDTO dto) {
        return employeeDomainService.customPage(dto);
    }

    @Override
    public void deleteById(Long id) {
        employeeDomainService.deleteById(id);
    }

    @Override
    public void update(EmployeeDTO dto) {
        employeeDomainService.update(dto);
    }

    @Override
    public EmployeeVO getBy(Long id) {
        return employeeDomainService.getBy(id);
    }
}
